// @ts-ignore
import { pdfExportMulti, pdfExportSingle } from '@/utils/pdf.ts'

export function useDocExport() {
  function handleDocExport(dom, orientation, fileName, callback) {
    pdfExportSingle(
      dom,
      {
        scale: 4,
        orientation: orientation || 'portrait',
        fileName
      },
      callback
    )
  }

  function handleDocExportMulti(doms, orientation, fileName, callback) {
    pdfExportMulti(
      doms,
      {
        scale: 2,
        orientation: orientation || 'portrait',
        fileName
      },
      callback
    )
  }

  return {
    handleDocExport,
    handleDocExportMulti
  }
}
